//  数据模拟
var data = {
    "IsOpenAccount":{"login_response":{"res_sign":"C355F78CC97BAB55CA5ED4FFA809A83A","res_timestamp":20171212091436,"resp_code":1201,"resp_msg":"收银员已开户"}},
    "signIn": {
        code: "login_success",
        msg: "登录成功",
        token: "dfsf234cmnvk3iwfd", // 加密token用每次数据请求验证当前登录是否有效
        power: {
            "verify": "all", //验证 表示全部的子菜单
            "query": "all", // 查询 "intraday,history":当天查询记录和历史查询记录和"all"是一样 | "history" | "intraday"
            "combination": "all", // 验证组合管理 "existing,setup"
            "accounts": "all", // 帐务管理 "timesCount,charging,balance"
            "users": "all" // 用户管理 "mechanism,staff_"
        }
    },
    "signIn1": {
        code: "0000",
        msg: "登录成功",
        token: "dfsf234cmnvk3iwfd", // 加密token用每次数据请求验证当前登录是否有效
        power: {
            "verify": "all", // 表示全部的子菜单
            "query": "all",
            "users": "staff"
        }
    },
    "signIn2": {
        code: "0001",
        msg: "登录失败"
    },
    "queryRecord": {
        "pageNo": 1,
        "pageSize": 20,
        "totalPage": 5,
        "totalCount": 5,
        "data": [{
            "id": 1,
            "qyBatchId": "342648762343_002_1496231096048",
            "insertime": 1496235548000,
            "pkgId": "002",
            "name": "徐奇峰",
            "queryStatus": "1",
            "operatorName": null,
            "phone": null
        }, {
            "id": 2,
            "qyBatchId": "342648762343_002_1496231133396",
            "insertime": 1496235550000,
            "pkgId": "002",
            "name": "徐奇峰",
            "queryStatus": "1",
            "operatorName": null,
            "phone": null
        }, {
            "id": 3,
            "qyBatchId": "342648762343_002_1496231192561",
            "insertime": 1496235552000,
            "pkgId": "002",
            "name": "徐奇峰",
            "queryStatus": "1",
            "operatorName": null,
            "phone": null
        }, {
            "id": 4,
            "qyBatchId": "342648762343_002_1496231444146",
            "insertime": 1496235554000,
            "pkgId": "002",
            "name": "徐奇峰",
            "queryStatus": "1",
            "operatorName": null,
            "phone": null
        }, {
            "id": 5,
            "qyBatchId": "342648762343_002_1496231667115",
            "insertime": 1496235573000,
            "pkgId": "002",
            "name": "徐奇峰",
            "queryStatus": "1",
            "operatorName": null,
            "phone": null
        }],
        "offset": 0
    },
    "queryRecord1": {
        "pageNo": 1,
        "pageSize": 20,
        "totalPage": 5,
        "totalCount": 5,
        "data": [],
        "offset": 0
    },
    "queryRecord2": {
        code: "0000",
        msg: "查询成功",
        record: [{
            orderId: "s123456",
            time: "2017-05-12 10:09:23",
            groupName: "组合B",
            yhName: "西恩",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123457",
            time: "2017-05-12 10:19:23",
            groupName: "组合B",
            yhName: "大师法",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123458",
            time: "2017-05-12 10:29:23",
            groupName: "组合B",
            yhName: "陈大",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123459",
            time: "2017-05-12 10:39:23",
            groupName: "组合C",
            yhName: "赖柯南",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123410",
            time: "2017-05-12 10:49:23",
            groupName: "组合B",
            yhName: "丹佛斯",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123411",
            time: "2017-05-12 10:50:23",
            groupName: "组合B",
            yhName: "大富翁",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123412",
            time: "2017-05-12 10:43:23",
            groupName: "组合B",
            yhName: "乐东方",
            statemsg: "成功",
            phone: "18716871730"
        }, {
            orderId: "s123413",
            time: "2017-05-12 10:58:23",
            groupName: "组合B",
            yhName: "芬村",
            statemsg: "成功",
            phone: "18716871730"
        }]
    },
    "users": {
        "pageNo": 1,
        "pageSize": 100,
        "totalPage": 1,
        "totalCount": 1,
        "data": [{
            "id": 0,
            "userId": "00123123",
            "userName": "测试",
            "roleId": "1",
            "moblNo": null,
            "insertime": 1496282771000,
            "status": "1"
        }],
        "offset": 0
    },
    "identify_0": {
        "code": "0131",
        "msg": "组织机构不存在或被禁用，不能进行查询",
        "verify": null,
        "verifyMsg": null,
        "seralNo": null,
        "power": null,
        "next": null,
        "interId": null,
        "funcId": null,
        "channelId": null,
        "data": null,
        "name": null,
        "idCard": null,
        "phoneNo": null,
        "bankNo": null
    },
    "identify0": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "0",
        "verifyMsg": "79",
        "seralNo": "342648762343_001_1497517157107",
        "power": null,
        "next": "0",
        "interId": "0001",
        "funcId": "003",
        "channelId": null,
        "data": null,
        "name": "陈致财",
        "idCard": "35012519851223007X",
        "phoneNo": "18616952720",
        "bankNo": "625421884218851"
    },
    "identify-0": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "0",
        "verifyMsg": "77",
        "seralNo": "342648762343_002_1496219382777",
        "power": "true",
        "next": "1",
        "interId": "0001",
        "funcId": "003",
        "channelId": "tengxun"

    },
    "identify-1": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": null,
        "verifyMsg": null,
        "seranlNo": "342648762343_001_14980357006623",
        "power": "true",
        "next": "1",
        "interId": "0001",
        "funcId": "004",
        "channelId": "kexin",
        "data": null,
        "name": "陈致财",
        "idCard": "35012519851223007X",
        "phoneNo": "18616952720",
        "bankNo": "625421884218851"
    },
    "identify1": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "0",
        "verifyMsg": null,
        "seralNo": "342648762343_001_1497517157107",
        "power": null,
        "next": "0",
        "interId": "0001",
        "funcId": "004",
        "channelId": "kexin",
        "data": "",
        "name": "陈致财",
        "idCard": "35012519851223007X",
        "phoneNo": null,
        "bankNo": "625421884218851"
    },
    "identify-2": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "2",
        "verifyMsg": "",
        "seralNo": "342648762343_002_1496219382777",
        "power": "true",
        "next": "1",
        "interId": "1003",
        "channelId": "suanhua",
        "data": []
    },
    "identify2": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "2",
        "verifyMsg": "",
        "seralNo": "342648762343_001_1497517157107",
        "power": null,
        "next": "1",
        "interId": "1003",
        "funcId": "002",
        "channelId": "suanhua",
        "data": [],
        "name": "陈致财",
        "idCard": "35012519851223007X",
        "phoneNo": null,
        "bankNo": "625421884218851"
    },
    "identify3": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "41",
        "verifyMsg": null,
        "seralNo": "342648762343_003_1499755521861",
        "power": "true",
        "next": "1",
        "interId": "0002",
        "funcId": "006",
        "channelId": "tengxun",
        "data": null,
        "name": "徐奇峰",
        "idCard": "211321198502215613",
        "phoneNo": "13470291103",
        "bankNo": "6227********9881"
    },
    "identify4": {
        "code": "0000",
        "msg": "信用分计算完成",
        "verify": "[[\"id_info\",413.0],[\"behaviorial_character\",854.0],[\"consumption_data\",521.0],[\"outsider_score\",792.0],[\"social_data\",938.0],[\"wjt_credit\",643.0]]",
        "verifyMsg": "{\"suanhua\":{\"5001\":{\"data\":{\"cardScoreList\":[{\"cardNum\":\"6227602716989881\",\"data\":{\"dc_flag\":\"credit\",\"wlp_score\":\"3\",\"rsk_score\":\"562\",\"cst_score\":\"3\",\"cnp_score\":\"6\",\"account_no\":\"6227602716989881\",\"summary_score\":\"591\",\"cot_score\":\"632\",\"chv_score\":\"9\",\"cnt_score\":\"6\",\"crb_score\":\"0.018312002096\",\"cna_score\":\"2\",\"dsi_score\":\"0\"},\"name\":\"徐奇峰\",\"cardType\":2,\"dataStatus\":\"1\"}]},\"success\":true,\"status\":\"1\"},\"5003\":{\"data\":[{\"RFM_6_var6\":\"1\",\"RFM_6_var5\":\"43.63\",\"RFM_6_var2\":\"12\",\"RFM_6_var3\":\"88.8\",\"RFM_6_var1\":\"523.52\",\"cardType\":2,\"dataStatus\":\"1\",\"RFM_12_var30\":\"0\",\"RFM_12_var40\":\"0\",\"cot_score\":\"632\",\"cardNum\":\"6227602716989881\",\"MCC_6_var1\":\"3\",\"RFM_12_var47\":\"0\",\"name\":\"徐奇峰\",\"cna_score\":\"2\",\"MON_6_var1\":\"3\",\"LOC_6_var11\":\"辽宁省\"}],\"success\":true,\"status\":\"1\"},\"3012\":{\"data\":{\"telStatus\":\"正常\",\"segCardType\":\"\",\"isUseTime\":\"25个月及以上\",\"balance\":\"\",\"owing\":\"\",\"operator\":\"移动\"},\"success\":true,\"status\":\"1\"}}}",
        "seralNo": "342648762343_003_1499762069112",
        "power": null,
        "next": "0",
        "interId": "3012",
        "funcId": "008",
        "channelId": "suanhua",
        "data": null,
        "name": "徐奇峰",
        "idCard": "211321198502215613",
        "phoneNo": "13470291103",
        "bankNo": "6227********9881"
    },

    "account": {
        "code": "0000",
        "msg": "",
        "data": [{
            "pkgId": "001",
            "rchrTotalCount": "10000",
            "qurTotalCount": null,
            "useableCount": null
        }, {
            "pkgId": "002",
            "rchrTotalCount": "10000",
            "qurTotalCount": "6",
            "useableCount": "0"
        }, {
            "pkgId": "003",
            "rchrTotalCount": "10000",
            "qurTotalCount": null,
            "useableCount": null
        }]
    },
    "details": [{
            "code": "0000",
            "msg": "信用分计算完成",
            "verify": "[[\"id_info\",413.0],[\"behaviorial_character\",854.0],[\"consumption_data\",521.0],[\"outsider_score\",792.0],[\"social_data\",938.0],[\"wjt_credit\",643.0]]",
            "verifyMsg": "{\"suanhua\":{\"5001\":{\"data\":{\"cardScoreList\":[{\"cardNum\":\"6227602716989881\",\"data\":{\"dc_flag\":\"credit\",\"wlp_score\":\"3\",\"rsk_score\":\"562\",\"cst_score\":\"3\",\"cnp_score\":\"6\",\"account_no\":\"6227602716989881\",\"summary_score\":\"591\",\"cot_score\":\"632\",\"chv_score\":\"9\",\"cnt_score\":\"6\",\"crb_score\":\"0.018312002096\",\"cna_score\":\"2\",\"dsi_score\":\"0\"},\"name\":\"徐奇峰\",\"cardType\":2,\"dataStatus\":\"1\"}]},\"success\":true,\"status\":\"1\"},\"5003\":{\"data\":[{\"RFM_6_var6\":\"1\",\"RFM_6_var5\":\"43.63\",\"RFM_6_var2\":\"12\",\"RFM_6_var3\":\"88.8\",\"RFM_6_var1\":\"523.52\",\"cardType\":2,\"dataStatus\":\"1\",\"RFM_12_var30\":\"0\",\"RFM_12_var40\":\"0\",\"cot_score\":\"632\",\"cardNum\":\"6227602716989881\",\"MCC_6_var1\":\"3\",\"RFM_12_var47\":\"0\",\"name\":\"徐奇峰\",\"cna_score\":\"2\",\"MON_6_var1\":\"3\",\"LOC_6_var11\":\"辽宁省\"}],\"success\":true,\"status\":\"1\"},\"3012\":{\"data\":{\"telStatus\":\"正常\",\"segCardType\":\"\",\"isUseTime\":\"25个月及以上\",\"balance\":\"\",\"owing\":\"\",\"operator\":\"移动\"},\"success\":true,\"status\":\"1\"}}}",
            "seralNo": "342648762343_003_1499762069112",
            "power": null,
            "next": "0",
            "interId": "3012",
            "funcId": "008",
            "channelId": "suanhua",
            "data": null,
            "name": "徐奇峰",
            "idCard": "211321198502215613",
            "phoneNo": "13470291103",
            "bankNo": "6227********9881"
        }, {
            "code": "0000",
            "msg": "信息查询成功",
            "verify": "41",
            "verifyMsg": null,
            "seralNo": "342648762343_003_1499755521861",
            "power": "true",
            "next": "1",
            "interId": "0002",
            "funcId": "006",
            "channelId": "tengxun",
            "data": null,
            "name": "徐奇峰",
            "idCard": "211321198502215613",
            "phoneNo": "13470291103",
            "bankNo": "6227********9881"
        }

        , {
            "code": "0000",
            "msg": "信息查询成功",
            "verify": "2",
            "verifyMsg": "",
            "seralNo": "342648762343_001_1497517157107",
            "power": null,
            "next": null,
            "interId": "1003",
            "funcId": "002",
            "channelId": "suanhua",
            "data": [],
            "name": "陈致财",
            "idCard": "35012519851223007X",
            "phoneNo": null,
            "bankNo": "625421884218851"
        }, {
            "code": "0000",
            "msg": "信息查询成功",
            "verify": "0",
            "verifyMsg": null,
            "seralNo": "342648762343_001_1497517157107",
            "power": null,
            "next": null,
            "interId": "0001",
            "funcId": "004",
            "channelId": "kexin",
            "data": "",
            "name": "陈致财",
            "idCard": "35012519851223007X",
            "phoneNo": null,
            "bankNo": "625421884218851"
        }, {
            "code": "0000",
            "msg": "信息查询成功",
            "verify": "0",
            "verifyMsg": "79",
            "seralNo": "342648762343_001_1497517157107",
            "power": null,
            "next": null,
            "interId": "0001",
            "funcId": "003",
            "channelId": "tengxun",
            "data": null,
            "name": "陈致财",
            "idCard": "35012519851223007X",
            "phoneNo": "18616952720",
            "bankNo": "625421884218851"
        }
    ],
    "showData": {
        "code": "0000",
        "msg": null,
        "data": {
            "id": 1,
            "userId": "0001",
            "userName": "测试",
            "roleId": "1",
            "moblNo": "15239128281",
            "insertime": 1496320189000,
            "status": "1"
        }
    },
    "addUser": {
        "code": "0000",
        "msg": null,
        "data": null
    },
    "homeData": {
        "code": "0000",
        "msg": "主页跳转",
        "data": {
            "roleId": "0",
            "merId": "123123123",
            "userName": "测试",
            "phoneNo": "18096775688"
        }
    },
    "wxquanxian": {
        "appid": "wxe37d6694983dc8ae",
        "nonceStr": "4e5bee1e-afc9-4c95-b0ad-d8dd2635a350",
        "signature": "9c24d75598ef7e53c0e9288651a4da2f420cc051",
        "timestamp": "20170605135603",
        "url": "http://tangjun.iok.la/dist/faceDetect/faceDetect.html"
    },
    "kexin001": {
        "code": "0000",
        "msg": "信息查询成功",
        "verify": "0",
        "verifyMsg": null,
        "seralNo": "342648762343_002_1496301221474",
        "power": "true",
        "next": "1",
        "interId": "0001",
        "funcId": "004",
        "channelId": "kexin",
        "data": ""
    },
    "faceNum": {
        code: "0000",
        data: {
            validate_data: "2354"
        }
    },
    "uppwd": {
        "code": "0000",
        "msg": "密码修改成功",
        "data": null
    },
    "scoreIndex": {
        "code": "0000",
        "data": [{
            "id": 5,
            "value1": "800",
            "valueType": "信用分",
            "value2": "1000",
            "valueName": "极好",
            "message": "[800,1000)"
        }, {
            "id": 4,
            "value1": "700",
            "valueType": "信用分",
            "value2": "800",
            "valueName": "优秀",
            "message": "[700,800)"
        }, {
            "id": 3,
            "value1": "600",
            "valueType": "信用分",
            "value2": "700",
            "valueName": "良好",
            "message": "[600,700)"
        }, {
            "id": 2,
            "value1": "500",
            "valueType": "信用分",
            "value2": "600",
            "valueName": "一般",
            "message": "[500,600)"
        }, {
            "id": 1,
            "value1": "0",
            "valueType": "信用分",
            "value2": "500",
            "valueName": "较差",
            "message": "[0,500)"
        }]
    }


};


/***********通商通兑商户交易记录模拟数据*****************************/
var tstdjyjl = {
    "tltdtrans_response": {
        "res_timestamp": 20170822152439,
        "res_sign": "E413ADCB0ACD4B9C4034FA815FA75C76",
        "trans_info_arrays": {
            "trans_info": [{
                "trans_time": 165353,
                "trans_status": "退货中",
                "trans_seq": 8876,
                "trans_date": 20170817165353,
                "term_id": "*",
                "goods_Amount": 9999,
                "trans_type": "退货中",
                "trans_amt": 9999,
                "order_id": "20170817165202425s"
            }, {
                "trans_time": 154104,
                "trans_status": "交易成功",
                "trans_seq": 8875,
                "trans_date": 20170817154104,
                "term_id": "*",
                "goods_Amount": 600,
                "trans_type": "退货",
                "trans_amt": 600,
                "order_id": "201708171539052699s"
            }, {
                "trans_time": 153219,
                "trans_status": "交易成功",
                "trans_seq": 8874,
                "trans_date": 20170817153219,
                "term_id": "*",
                "goods_Amount": 600,
                "trans_type": "退货",
                "trans_amt": 600,
                "order_id": "201708171531066915s"
            }, {
                "trans_time": 152736,
                "trans_status": "交易成功",
                "trans_seq": 8873,
                "trans_date": 20170817152736,
                "term_id": "*",
                "goods_Amount": 600,
                "trans_type": "退货",
                "trans_amt": 708,
                "order_id": "201708171524578268s"
            }, {
                "trans_time": 152715,
                "trans_status": "交易成功",
                "trans_seq": 8872,
                "trans_date": 20170817152715,
                "term_id": "*",
                "goods_Amount": 9999,
                "trans_type": "退货",
                "trans_amt": 9999,
                "order_id": "20170817152546402s"
            }, {
                "trans_time": 152715,
                "trans_status": "交易成功",
                "trans_seq": 8872,
                "trans_date": 20170817152715,
                "term_id": "*",
                "goods_Amount": 9999,
                "trans_type": "退货(不免息)",
                "trans_amt": 888.88,
                "order_id": "20170817152546402s"
            }]
        },
        "resp_msg": "查询交易流水成功",
        "resp_code": "0000"
    }
    
}

// 取是否绑定银行卡
function getIsOpenAccount(argument) {
    return this.data.IsOpenAccount;
}

/********轧差模拟数据*****/
var MerDopeReData = {
    "lfq_search_order_response": {
        "res_timestamp": 20170824095804,
        "res_sign": "EC1C1ED25619B10EB8499056097171CC",
        "sumTerms": 1,
        "contractsCode": "HT20170823160055000058",
        "contractsState": 1,
        "resp_msg": "成功",
        "remainAmount": 113862,
        "resp_code": "0000",
        "receipt": 1,
        "sumAmount": 22772,
        "cancelAmount": 131852,
        "orderId": "011503475254817206983"
    }
};

function getSingInData(paraments) {
    console.log("getSingInData-------------" + paraments.username + "----" + paraments.password);
    if (paraments.username == "admin" && paraments.password == "8888") {
        return this.data.signIn;
    } else if (paraments.institution == "test" && paraments.username == "test" && paraments.password == "8888") {
        return this.data.signIn1;
    } else {
        console.log("getSingInDat 2222-------------");
        return this.data.signIn2;
    }
}

function getQueryRecordServlet(paraments) {
    console.log("getQueryRecordServlet------------------");
    return this.data.queryRecord;

}

function getRecorddetail(argument) {
    return this.data.queryRecord;
}

function getAccountsDetails(argument) {
    console.log("getAccountsDetails getAccountsDetails------------------");
    return this.data.details;
}

function getUsers(argument) {
    return this.data.users;
}

function getshowData(argument) {
    return this.data.showData;
}


function getIdentify1(paraments) {
    if (paraments.step == "0") {
        return this.data.identify0;
    } else if (paraments.step == "1") {
        return this.data.identify1;
    } else if (paraments.step == "2") {
        return this.data.identify2;
    } else if (paraments.step == "3") {
        return this.data.identify3;
    } else if (paraments.step == "4") {
        return this.data.identify4;
    }

}

function getaddUser() {
    return this.data.addUser;
}

function gethomeData() {
    return this.data.homeData;
}

// 取微信权限
function getwxquanxian(argument) {
    return this.data.wxquanxian;
}

// 可信001 模拟数据
function getkexin001(argument) {
    return this.data.kexin001;
}

// 模拟数据
function getQueryData(argument) {
    console.log("getQueryDate----------" + argument.step);
    if (argument.step == "0") {
        return this.data.identify0;
    } else if (argument.step == "1") {
        return this.data.identify1;
    } else if (argument.step == "2") {
        return this.data.identify2;
    } else if (argument.step == "3") {
        return this.data.identify3;
    } else if (argument.step == "4") {
        return this.data.identify4;
    }

}

// 模拟4个数字
function getFaceNum(argument) {
    return this.data.faceNum;
}


// 修改密码成功
function getuppwd() {
    return this.data.uppwd;
}

// 取评级
function getScoreIndex() {
    return this.data.scoreIndex;
}


// 通商通兑商户交易记录模拟数据
function gettstdshjyjl() {
    return tstdjyjl;
}

// 轧差退货金额
function getMerRefundsServlet () {
    return MerDopeReData;
}

module.exports = {
    "data": data,
    "getSingInData": getSingInData,
    "getQueryRecordServlet": getQueryRecordServlet,
    "getIdentify1": getIdentify1,
    "getAccountsDetails": getAccountsDetails,
    "getUsers": getUsers,
    "getshowData": getshowData,
    "getaddUser": getaddUser,
    "gethomeData": gethomeData,
    "getwxquanxian": getwxquanxian,
    "getkexin001": getkexin001,
    "getQueryData": getQueryData,
    "getFaceNum": getFaceNum,
    "getuppwd": getuppwd,
    "getScoreIndex": getScoreIndex,
    "gettstdshjyjl": gettstdshjyjl,
    "getMerRefundsServlet": getMerRefundsServlet,
    "getIsOpenAccount": getIsOpenAccount
};
